package com.aphrodite.io.sip.dialog;

import java.util.Vector;

import com.aphrodite.io.sip.address.NameAddress;

/**
 * Class DialogInfo maintains a complete information status of a generic SIP
 * dialog. It has the following attributes:
 * <ul>
 * <li>sip-provider</li>
 * <li>call-id</li>
 * <li>local and remote URLs</li>
 * <li>local and remote contact URLs</li>
 * <li>local and remote cseqs</li>
 * <li>local and remote tags</li>
 * <li>dialog-id</li>
 * <li>route set</li>
 * </ul>
 */
public class DialogInfo {

	// ************************ Private attributes ************************

	/** Call-id */
	String call_id;

	/** Local contact url */
	NameAddress local_contact;

	/** Local CSeq number */
	long local_cseq;

	/** Local name */
	NameAddress local_name;

	/** Local tag */
	String local_tag;

	/** Remote contact url */
	NameAddress remote_contact;

	/** Remote CSeq number */
	long remote_cseq;

	/** Remote name */
	NameAddress remote_name;

	/** Remote tag */
	String remote_tag;
	/** Sets the remote tag */

	/** Route set (Vector of NameAddresses) */
	Vector route;

	// **************************** Costructors ***************************

	/** Creates a new empty DialogInfo */
	public DialogInfo() {
		this.local_name = null;
		this.remote_name = null;
		this.local_contact = null;
		this.remote_contact = null;
		this.call_id = null;
		this.local_tag = null;
		this.remote_tag = null;
		this.local_cseq = -1;
		this.remote_cseq = -1;
		this.route = null;
	}

	// ************************** Public methods **************************

	/** Gets the call-id */
	public String getCallID() {
		return call_id;
	}

	/** Gets the local contact url */
	public NameAddress getLocalContact() {
		return local_contact;
	}

	/** Gets the local CSeq number */
	public long getLocalCSeq() {
		return local_cseq;
	}

	/** Gets the local name */
	public NameAddress getLocalName() {
		return local_name;
	}

	/** Gets the local tag */
	public String getLocalTag() {
		return local_tag;
	}

	/** Gets the remote contact url */
	public NameAddress getRemoteContact() {
		return remote_contact;
	}

	/** Gets the remote CSeq number */
	public long getRemoteCSeq() {
		return remote_cseq;
	}

	/** Gets the remote name */
	public NameAddress getRemoteName() {
		return remote_name;
	}

	/** Gets the remote tag */
	public String getRemoteTag() {
		return remote_tag;
	}

	/** Gets the route set */
	public Vector getRoute() {
		return route;
	}

	/** Increments the local CSeq number */
	public void incLocalCSeq() {
		local_cseq++;
	}

	/** Increments the remote CSeq number */
	public void incRemoteCSeq() {
		remote_cseq++;
	}

	/** Sets the call-id */
	public void setCallID(String id) {
		call_id = id;
	}

	/** Sets the local contact url */
	public void setLocalContact(NameAddress name_address) {
		local_contact = name_address;
	}

	/** Sets the local CSeq number */
	public void setLocalCSeq(long cseq) {
		local_cseq = cseq;
	}

	/** Sets the local name */
	public void setLocalName(NameAddress url) {
		local_name = url;
	}

	/** Sets the local tag */
	public void setLocalTag(String tag) {
		local_tag = tag;
	}

	/** Sets the remote contact url */
	public void setRemoteContact(NameAddress name_address) {
		remote_contact = name_address;
	}

	/** Sets the remote CSeq number */
	public void setRemoteCSeq(long cseq) {
		remote_cseq = cseq;
	}

	/** Sets the remote name */
	public void setRemoteName(NameAddress url) {
		remote_name = url;
	}

	public void setRemoteTag(String tag) {
		remote_tag = tag;
	}

	/** Sets the route set */
	public void setRoute(Vector r) {
		route = r;
	}

}
